home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / vblay132 / readme.txt < prev    next >
Text File  |  1998-12-22  |  5KB  |  154 lines

  1. VB Layout 1.32
  2. ==============
  3.                           
  4. VBLAYOUT.OCX by Paul Wannbaeck (pwk@hem1.passagen.se)
  5.  
  6. Freeware. Freely distributable.
  7.  
  8. Purpose
  9. =======
  10. ActiveX control for Visual Basic. Resizes and moves selected controls as
  11. specified when the form is resized. Saves some time off the tedious Form_Resize
  12. coding.
  13.  
  14. Files:
  15. ======
  16. VBLAYOUT.OCX    The VB Layout ActiveX control
  17. README.TXT        This file.
  18. DEMO5.ZIP        VB 5 Demo project with exe & source. Requires VB 5 runtime DLL.
  19. DEMO6.ZIP       VB 6 Demo project with exe & source. Requires VB 6 runtime DLL.
  20.  
  21. Requirements
  22. ============
  23. Win95/NT. MS Visual Basic 32 bit. Has been tested with VB 5 & 6 in Win95 and NT4.0
  24.  
  25. Revision history
  26. ================
  27. 1.32    VB crashed when terminating an app with more than 8 MDI windows containing VB Layout.
  28.         This can be a VB6 bug, but it helped to remove AddRef/Release on the IDispatch given
  29.         in the AddControl call.
  30. 1.31    If size was rapidly decreased to original or less than original, VB Layout didn't
  31.         restore to original control size & placement.
  32. 1.3        Now works with controls contained in a MS Tabbed Dialog (SSTab). The SSTab 
  33.         Control hides controls in non-active tabs by moving them left 75000 units. VB
  34.         Layout is now aware of this.
  35. 1.2A    Corrected documentation and demo bug regarding MDI childs
  36. 1.2        Fixed minor bug when calling OnSize without any controls added.
  37.         256 control limitation removed.
  38.         Enhanced documentation. Demo VB project.
  39. 1.1        First version on the Net.
  40. 1.0        The first version
  41.  
  42. Installation
  43. ============
  44. Copy the file VBLAYOUT.OCX to an appropriate location. Register it with regsvr32
  45. or through Visual Basic (Components->Browse...).
  46.  
  47. Feedback & bug reports
  48. ======================
  49. Email: pwk@hem1.passagen.se
  50.  
  51. Documentation
  52. =============
  53. This Visual Basic control saves some time off the tedious coding in
  54. Form_Resize.
  55.  
  56. Just add the layout manager to the form, add the managed controls to it 
  57. (LayoutMgr1.AddControl) in Form_Load and call LayoytMgr1.OnSize in Form_Resize.
  58.  
  59. When the first AddControl is called, the layout manager records the form size
  60. and uses that size as a base for resizing. 
  61.  
  62. Methods:
  63. ========
  64.  
  65. AddControl(Control as Object, xMove as Double, yMove as Double, xSize as Double, ySize as Double)
  66.     Adds a control to the layout manager. The original position and size of the
  67.     control is recorded as a base for resizing. 
  68.  
  69.     The xMove,yMove,xSize and ySize parameters should be assigned a value between 0.0 and 1.0.
  70.  
  71.     Parameters:
  72.         Control        The control to add
  73.         xMove        x movement. New control.Left = original control.Left + xMove * (new formwidth - old formwidth)
  74.                     0.0 = no movement
  75.                     0.5 = 50 % movement
  76.                     1.0 = 100 % movement
  77.         yMove        y movement. New control.Top = original control.Top + yMove * (new formheight - old formheight)
  78.                     0.0 = no movement
  79.                     0.5 = 50 % movement
  80.                     1.0 = 100 % movement
  81.         xSize        x sizing. New controlwidth = original controlwidth + xSize * (new formwidth - old formwidth)
  82.                     0.0 = no sizing
  83.                     0.5 = 50 % sizing
  84.                     1.0 = 100 % sizing
  85.         ySize        y sizing. New controlheight = original controlheight + ySize * (new formheight - old formheight)
  86.                     0.0 = no sizing
  87.                     0.5 = 50 % sizing
  88.                     1.0 = 100 % sizing
  89.         
  90.  
  91. OnSize()
  92.     Moves and resizes the controls as specified.
  93.  
  94. Properties:
  95. ===========
  96. None
  97.  
  98. Runtime:
  99. ========
  100. Invisible
  101.  
  102. A note regarding MDI Child Windows:
  103. ===================================
  104. VB Layout records the form size when the first control is added. For dialogs,
  105. this is normally the design time form size. MDI Child form initial size can be
  106. other than the design time size. To make VB Layout work correctly, reset
  107. the form size to the design time size before adding the first control.
  108. Example:
  109.     Form_Load()
  110.         .
  111.         .
  112.         oldWidth = Width
  113.         oldHeight = Height
  114.         Width = 3500;
  115.         Height = 4500;
  116.         LayoutMgr1.AddControl List1, 0, 0, 0.5, 1
  117.         .
  118.         .
  119.         LayoutMgr1.AddControl Button59, 0, 0, 0.5, 1
  120.         Width = oldWidth
  121.         Height = oldHeight
  122.         .
  123.         .
  124. The Demo project (see below) uses this method.
  125.  
  126. Demo VB project:
  127. ================
  128. VB 5 Demo with exe & source in DEMO.ZIP
  129.  
  130. Example:
  131. ========
  132.  
  133. Test this example:
  134.  
  135. Design a form with:
  136.     a layout manager
  137.     a listbox List1 in upper left corner (disable integral height, it behaves better)
  138.     a button  Command1 in upper right corner
  139.     a button  Command2 in lower right corner
  140.     a button  Command1 in lower left corner
  141.  
  142. Form_Load
  143.     LayoutMgr1.AddControl List1, 0, 0, 1, 1
  144.     LayoutMgr1.AddControl Command1, 1, 0, 0, 0
  145.     LayoutMgr1.AddControl Command2, 1, 1, 0, 0
  146.     LayoutMgr1.AddControl Command3, 0, 1, 0, 0
  147.  
  148. Form_Resize
  149.     LayoutMgr1.OnSize
  150.  
  151. Miscellaneous:
  152. ==============
  153. VB Layout was written in MS C++ using MS ATL (Active Template Library).
  154.